package com.bsoft.Consumer;

import com.alibaba.fastjson.JSON;
import com.bsoft.pojo.Demo01Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RabbitListener(queues = Demo01Message.QUEUE)
public class Demo01Consumer {
    @RabbitHandler
    public void onMessage(Demo01Message message) {
        log.info(JSON.toJSONString(message));
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }

}
